package com.algorithm.lesson_05;

import org.junit.Test;

public class LessonTest {
	
	

	@Test
	public void testHanoiStack() {
		int num = 4;
		int steps = Hanoi.hanoiStack(num, "left", "mid", "right");
		System.out.println("It will move " + steps + " steps.");
	}

	@Test
	public void testHanoiRecursive() {
		int num = 4;
		int steps = Hanoi.HanoiRecursive(num, "left", "mid", "right");
		System.out.println("It will move " + steps + " steps.");
	}

	@Test
	public void testDogCatQueue() {
		DogCatQueue queue = new DogCatQueueImpl();

		Pet dog1 = new Dog("dog1");
		Pet cat1 = new Cat("cat1");
		Pet dog2 = new Dog("dog2");
		Pet cat2 = new Cat("cat2");
		Pet dog3 = new Dog("dog3");
		Pet cat3 = new Cat("cat3");

		queue.add(dog1);
		queue.add(cat1);
		queue.add(dog2);
		queue.add(cat2);
		queue.add(dog3);
		queue.add(cat3);

		queue.add(dog1);
		queue.add(cat1);
		queue.add(dog2);
		queue.add(cat2);
		queue.add(dog3);
		queue.add(cat3);

		queue.add(dog1);
		queue.add(cat1);
		queue.add(dog2);
		queue.add(cat2);
		queue.add(dog3);
		queue.add(cat3);
		while (!queue.isDogEmpty()) {
			System.out.println(queue.pollDog());
		}
		while (!queue.isEmpty()) {
			System.out.println(queue.pollAll());
		}
	}
}
